package com.fxf.srb.core.controller.admin;

import com.fxf.common.result.R;
import com.fxf.srb.core.pojo.entity.UserLoginRecord;
import com.fxf.srb.core.service.IUserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 饭小范
 * @version 1.0
 * @description: TODO
 * @date 2021/5/30 14:42
 */
@Api(tags = "会员登陆日志接口")
@RequestMapping("/admin/core/userLoginRecord")
@RestController
@Slf4j
@CrossOrigin
public class AdminUserLoginRecordController {

    @Resource
    private IUserLoginRecordService userLoginRecordService;

    @ApiOperation("获取会员登录日志列表")
    @GetMapping("/listTop50/{userId}")
    public R listTop80(
            @ApiParam(value = "用户id",required = true)
            @PathVariable Long userId){

        List<UserLoginRecord> userLoginRecords = userLoginRecordService.listTop50(userId);
        return R.ok().data("list",userLoginRecords);


    }


}
